package com.example.demo.service;

import com.example.demo.mapper.ScoreMapper;
import com.example.demo.model.UserScore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ScoreService {
    @Autowired
    private ScoreMapper scoreMapper;

    public List<UserScore> getAllScores() {
        return scoreMapper.getAll();
    }

    public int add(UserScore userScore) {
        return scoreMapper.addUserScore(userScore);
    }

    public int update(UserScore userScore) {
        return scoreMapper.updateUserScore(userScore);
    }

    public int deleteById(int id) {
        return scoreMapper.deleteUserScoreById(id);
    }

    public UserScore getById(int id) {
        return scoreMapper.getUserScoreById(id);
    }

}
